namespace PHMEE.PHM.Algorithms.Diagnosis;

/// <summary>
/// 风机故障诊断算法 2 - （用于风机类型是直驱式）
/// </summary>
public class AirBlowerAlg2
{
    private readonly AirBlower2Service.AirBlower2ServiceClient _client;

    public AirBlowerAlg2(AirBlower2Service.AirBlower2ServiceClient client)
    {
        _client = client;
    }
    
    /// <summary>
    /// 风机故障诊断算法 2 - （用于风机类型是直驱式）
    /// </summary>
    /// <param name="pointPosition"></param>
    /// <param name="data"></param>
    /// <param name="sampleRate"></param>
    /// <param name="equipmentParameters"></param>
    /// <param name="thresholds"></param>
    /// <returns></returns>
    public async Task<AirBlower2Response> AirBlower2Async(PointPosition pointPosition, float[] data, float sampleRate,
        AirBlower2EquipmentParameters equipmentParameters, AirBlower2Thresholds thresholds)
    {
        var request = new AirBlower2Request
        {
            Position = pointPosition,
            Data = { data },
            SampleRate = sampleRate,
            EquipmentParameters = equipmentParameters,
            Thresholds = thresholds
        };

        var response = await _client.AirBlower2AlgAsync(request);

        return response;
    }
}